home *** CD-ROM | disk | FTP | other *** search
- Path: dd.chalmers.se!news.chalmers.se!sunic!trane.uninett.no!eunet.no!EU.net!news.eunet.fi!news.csc.fi!news.funet.fi!nntp.hut.fi!nntp.hut.fi!s37732v
- From: s37732v@snakemail.hut.fi (Markus Juhani Aalto)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Boopsi, layers and clipping???
- Date: 20 Mar 94 08:33:25 GMT
- Organization: Helsinki University of Technology, Finland
- Lines: 70
- Distribution: inet
- Message-ID: <S37732V.94Mar20103326@alpha.hut.fi>
- References: <1994Mar19.115854.29062@ida.liu.se>
- NNTP-Posting-Host: alpha.hut.fi
- In-reply-to: d92patla@odalix.ida.liu.se's message of Sat, 19 Mar 1994 11:58:54 GMT
-
- In article <1994Mar19.115854.29062@ida.liu.se> d92patla@odalix.ida.liu.se (Patrik Lantto) writes:
-
- > Hello!
-
- > Here's a delicate problem for someone to solve!
-
- > What's the proper way to do clipping when rendering a boopsi-gadget?
-
- > I've tried the following:
-
- > ...
-
- > struct GadgetInfo *ginfo = msg->gpr_GInfo;;
- > struct Region *old;
-
- > LockLayerInfo(ginfo->gi_Layer->LayerInfo);
- > LockLayer(NULL, ginfo->gi_Layer);
-
- > old = InstallClipRegion(ginfo->gi_Layer, myclipregion);
-
- > ... Rendering ...
-
- > InstallClipRegion(ginfo->gi_Layer, old);
- > UnlockLayer(ginfo->gi_Layer);
- > UnlockLayerInfo(ginfo->gi_Layer->LayerInfo);
-
- > ...
-
-
- > Rendering will be called whenever I change a prop-gadget, and
- > it works just fine, but the problem comes when my window needs
- > refreshing. The rendering routine will be called, it will render
- > inside my clipregion, but as the routine returns, the clipregion
- > is cleared, ie. nothing can be updated inside the window until it
- > is moved or resized. I guess the problem is that I'm inside a pair
- > of BeginUpdate() and EndUpdate(), but what to do about it?
-
- You have propably guessed correctly as it can be a problem. You can get
- around it however. First you check if it's window you are drawing
- to (get window ptr from GadgetInfo). Check if the WINDOWREFRESHING
- flag is up in Flags field and if it is then call EndUpdate(layer,FALSE)
- and after you have made rendering call BeginUpdate(layer).
-
- Note that you must call EndUpdate before you install new CLip region.
-
- > Any help, suggestions or whatever will be appreciated.
-
- I hope this helps. Oh and you can propably use BeginRefresh() and
- EndRefresh() too.
-
-
- > - Patrik
-
- > Patrik Lantto Email: d92patla@und.ida.liu.se
- > Plojaregatan 26 Phone: +46 13 212225
- > S-583 30 LINKOPING Best comic: "Ha! Wild Zontars couldn't drag that
- > Sweden information out of me! Do your worst!"
-
-
- --
-
-
- **************************************************************************
- * Markus Aalto | Helsinki University of Technology *
- * | *
- * EMail: s37732v@vipunen.hut.fi | Faculty of Electric Engineering *
- * Phone/Fax: 358-0-8746991 | *
- * | Undergraduate in Computer Science *
- **************************************************************************
-
-